<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
<meta name="decorator" content="sysDefault" />
<script type="text/javascript" src="${staticPath}/lib/ztree/3.5/js/jquery-1.4.4.min.js"></script>
<script src="${staticPath}/lib/ztree/3.5/js/jquery.ztree.all-3.5.js" type="text/javascript"></script>
<link rel="stylesheet" href="${staticPath}/lib/ztree/3.5/css/zTreeStyle/zTreeStyle.css" type="text/css">
<%-- <link rel="stylesheet" href="${staticPath}/lib/ztree/3.5/css/demo.css" type="text/css"> --%>
<script type="text/javascript">

	var  id="";
	var setting = {
		data: {
			simpleData: {
				enable: true
			}
		},
		callback: {
				onClick: onClick
			}
	};
	
	

	function onClick(event, treeId, treeNode, clickFlag) {
		id =treeNode.id;
		if(treeNode.level!=0){
			
			var url ='${contextPath}/sys/base/form/'+id+'/list';
			$("#iFrame1").attr("src",url);
		}else{
			
			var url ='${contextPath}/sys/base/form/0/list';
			$("#iFrame1").attr("src",url);
		}
		
		
	}
	
	
	function getUrlVersionFrame(url){ 
		  $("#versionFrame").attr("src",url);
	}
	$(document).ready(function() {
		   $.get("${contextPath}/sys/base/module/get",function(data){  
		        $('#result').text(data);//直接展示JSON数据
		        zNodes =eval("("+data+")");
		       $.fn.zTree.init($("#treeDemo"), setting, zNodes);
		   }); 
	});

	function funform(url,target){
		window.open(url,target);
	}
		
</script>
<style type="text/css">
.marginleft{
	margin-left:2px;
	margin-bottom:3px;
		}
.content{
	width:100%;
	padding:0 0 3px;
	margin:0;
	clear:both;
	}
.pane1{
	width:200px;
	margin-right:3px;
	margin-left:3px;
	float:left;
	}
.right{
	display:block;
	_width:auto;
	_float:left;
	}

.left-rightsplit{
	height:100%；
	border:2px solid #9FBDD7;

	}
.marginright{
	margin-right:3px;
	
}
.ztree li span.button.switch.level0 {visibility:hidden; width:1px;}
.ztree li ul.level0 {padding:0; background:none;}
</style>

</head>
<body>
<div class="content left-rightsplit" >
	<div id=""class="pane1 marginleft">
	  <fieldset>
		 <div class="panel panel-default">
		   <div class="panel-heading">
		    <h3 class="panel-title">
		    	模块类型
		    	<button class="btn btn-success btn-sm pull-right" role="button" onclick="funform('${contextPath}/sys/base/module/add','_self');">新增</button>
		    </h3>
			 </div>
		</div>
		<div style="position:absolute; top:40px;"  >
			<ul id="treeDemo" class="ztree"></ul>
		</div>
		
	  </fieldset>
	</div>
	<div id="" class="right marginleft marginright">
		<div class="right-top">
			<fieldset>
	 <iframe id="iFrame1" name="iFrame1" width="100%" style="height:700px"   frameborder="no" border="0" marginwidth="0" marginheight="0"  allowtransparency="yes" src="${contextPath}/sys/base/form/0/list"></iframe>
			</fieldset>
		</div>
		
	</div>
	
</body>
</html>